package com.guyan.form;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.Pattern;

/**
 * ClassName： UserForm
 * Date： 2021/6/16 17:51
 *
 * @author 孤焰
 * @version 1.0
 **/

@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserForm {
    // 用户名
    @Pattern(regexp = "^.{2,}$", message = "用户名至少有2位字符")
    private String username;
    // 用户密码
    @Pattern(regexp = "(.+){6,12}$", message = "密码必须6-12位")
    private String password;
    // 邮箱
    @Pattern(regexp = "^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$", message = "邮箱格式不正确")
    private String email;
    // 电话
    @Pattern(regexp = "^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\\d{8}$", message = "电话格式不正确")
    private String phone;
}
